<template>
	<view class="detail-view">
		<view class="top-bar"><uni-navbar :fixed="true" :back="true" color="#fff" title="内容详情"></uni-navbar></view>

		<view class="detail-info" v-if="motionInfo.id">
			<view class="info-title">
				<view class="title-top">{{ motionInfo.title }}</view>
				<view class="title-btm">
					<text class="btm-name">{{ motionInfo.leaderName }}</text>
					<!-- <text class="btm-name">{{ motionInfo.typeName }}</text> -->
					<text class="btm-time">{{ motionInfo.createTime }}</text>
				</view>
			</view>
		</view>

		<view class="uploader-add" @click="onTts">
			<image v-if="!play" src="/static/img/icon_76.png" mode="widthFix"></image>
			<image src="/static/img/icon_77.gif" v-else mode="widthFix"></image>
		</view>

		<u-tabs class="tab-fill-box" :list="tabsList" bgColor="#f5f6f8" :height="60" :font-size="28" :show-bar="false" :is-scroll="false" :is-fill="true" v-model="tabsCurrent" @change="tabsChange"></u-tabs>

		<view class="type-boxs" v-show="tabsCurrent == 0 && motionInfo.id">
			<view class="form-box form-box-show">
				<u-form ref="uForm">
					<u-form-item class="form-item" label="编号">{{ motionInfo.no ? motionInfo.no : '' }}</u-form-item>
					<u-form-item class="form-item" label="届次">{{ motionInfo.jieName + motionInfo.ciName }}</u-form-item>
					<!-- <u-form-item class="form-item" label="类别">{{ motionInfo.typeName }}</u-form-item> -->
					<u-form-item class="form-item" label="领衔代表">{{ leaderInfo.userName }}</u-form-item>
					<u-form-item class="form-item" label="代表证号">{{ leaderInfo.remark13 }}</u-form-item>
					<u-form-item class="form-item" label="附议代表">{{ jointlerList.length }}位</u-form-item>
				</u-form>

				<view class="table-box">
					<u-table class="table-inner" border-color="#F8F8F8">
						<u-tr>
							<u-th>姓名</u-th>
							<u-th>代表团</u-th>
							<u-th>联系电话</u-th>
						</u-tr>
						<view class="table-cell" v-for="(item, index) of jointlerList" :key="index">
							<u-tr>
								<u-td>{{ item.userName || '' }}</u-td>
								<u-td>{{ item.wyhdzName || '' }}</u-td>
								<u-td>{{ item.phone || '' }}</u-td>
							</u-tr>
						</view>
					</u-table>
				</view>
			</view>
		</view>
		<view class="type-boxs" v-show="tabsCurrent == 1">
			<view class="detail-info">
				<view class="info-detail">
					<view class="overflow"><uni-parse :content="motionInfo.background || ''"></uni-parse></view>
				</view>
			</view>

			<view class="file-list" v-if="fileList.length > 0">
				<view class="file-item" v-for="(item, index) in fileList" :key="index" @click="$showLine(item)">
					<view class="file-type"><image :src="imgpath(item.path)" mode="widthFix"></image></view>
					<view class="file-name clamp">
						{{ item.name }}
						<text class="file-time">{{ item.createTime }}</text>
					</view>
					<view class="right-type">预览</view>
				</view>
			</view>
		</view>
		<view class="type-boxs" v-show="tabsCurrent == 2">
			<view class="sched-box">
				<u-time-line class="sched-line">
					<u-time-line-item v-for="(item, index) in processList" :key="item.id">
						<template v-slot:content>
							<view class="sched-content">
								<view class="sched-title">{{ item.nodeName }}</view>
								<view class="sched-desc">{{ `时间：${item.operateTime || ''}` }}</view>
								<view class="sched-desc">{{ `操作人：${item.userName}` }}</view>
								<view class="sched-desc">{{ `描述：${item.miaoshu}` }}</view>
							</view>
						</template>
					</u-time-line-item>
				</u-time-line>
			</view>
		</view>
		<view class="type-boxs" v-show="tabsCurrent == 3">
			<block v-if="motionInfo.nodeStatus == '101'">
				<view class="com-h2"><text class="h2-title">代表团待审查</text></view>
				<block v-if="$sysMenus('dbtdsc')">
					<view class="fiexd-btm">
						<view class="flex-box">
							<u-button class="form-btn" type="error" @click="confirm1">通过</u-button>
							<u-button class="form-btn" type="success" @click="back1">退回</u-button>
						</view>
					</view>
				</block>
				<view class="com-h3" v-else>代表团待审查</view>
			</block>
			<block v-if="motionInfo.nodeStatus == '1'">
				<view class="com-h2"><text class="h2-title">代表室待审查</text></view>
				<block v-if="$sysMenus('dbsdsc')">
					<view class="fiexd-btm">
						<view class="flex-box">
							<u-button class="form-btn" type="error" @click="confirm2">通过</u-button>
							<u-button class="form-btn" type="success" @click="back2">退回</u-button>
						</view>
					</view>
				</block>
				<view class="com-h3" v-else>代表室待审查</view>
			</block>
			<block v-if="motionInfo.nodeStatus == '3'">
				<view class="com-h2"><text class="h2-title">待交办</text></view>
				<block v-if="$sysMenus('ta_djb')">
					<view class="form-box">
						<u-form :model="form2" ref="uForm2">
							<u-form-item class="form-item" required label="交办方式">
								<u-radio-group v-model="assignWay" :key="assignWay">
									<u-radio v-for="(item, index) in assignWayList" :key="index" :name="item.value">{{ item.label }}</u-radio>
								</u-radio-group>
							</u-form-item>
							<u-form-item class="form-item" label="主办单位" v-if="assignWay == '3'">
								<u-input v-model="zbName" type="select" :select-open="zbShow" placeholder="请选择主办单位" @click="zbShow = true" />
								<select-tree ref="zbTree" :show="zbShow" :range="zbList" :selected="zbStr" rangeKey="deptName" :multiple="false" :selectParent="false" @confirm="treeConfirm($event, 'zb')" @cancel="treeCancel($event, 'zb')"></select-tree>
							</u-form-item>
							<u-form-item class="form-item" label="协办单位" v-if="assignWay == '3'">
								<u-input v-model="xbName" type="select" :select-open="xbShow" placeholder="请选择协办单位" @click="xbShow = true" />
								<select-tree ref="xbTree" :show="xbShow" :range="xbList" :selected="xbStr" rangeKey="deptName" :selectParent="false" @confirm="treeConfirm($event, 'xb')" @cancel="treeCancel($event, 'xb')"></select-tree>
							</u-form-item>
						</u-form>
					</view>
					<view class="fiexd-btm">
						<view class="flex-box">
							<u-button class="form-btn" type="error" @click="confirm3">提交</u-button>
							<u-button class="form-btn" type="success" @click="back3">退回</u-button>
						</view>
					</view>
				</block>
				<view class="com-h3" v-else>待交办</view>
			</block>
			<block v-if="motionInfo.nodeStatus == '4'">
				<view class="com-h2"><text class="h2-title">交办中</text></view>
				<block v-if="$sysMenus('ta_jbz')">
					<view class="form-box">
						<u-form :model="form3" ref="uForm3">
							<u-form-item class="form-item" required label="办理类型">
								<u-radio-group v-model="handleType" :key="handleType">
									<u-radio v-for="(item, index) in handleTypeList" :key="index" :name="item.value">{{ item.label }}</u-radio>
								</u-radio-group>
							</u-form-item>
							<u-form-item class="form-item" label="申请退回时间" label-align="left" label-width="240">
								<u-input v-model="applyReturnDays" type="select" :select-open="applyReturnDaysShow" placeholder="请选择分类" @click="applyReturnDaysShow = true" />
								<u-select :list="applyReturnDaysList" v-model="applyReturnDaysShow" @confirm="applyReturnDaysConfirm"></u-select>
							</u-form-item>
							<u-form-item class="form-item" label="主办单位" v-if="handleType == 1">
								<u-input v-model="zbName" type="select" :select-open="zbShow" placeholder="请选择主办单位" @click="zbShow = true" />
								<select-tree ref="zbTree" :show="zbShow" :range="zbList" :selected="zbStr" rangeKey="deptName" :multiple="false" :selectParent="false" @confirm="treeConfirm($event, 'zb')" @cancel="treeCancel($event, 'zb')"></select-tree>
							</u-form-item>
							<u-form-item class="form-item" label="协办单位" v-if="handleType == 1">
								<u-input v-model="xbName" type="select" :select-open="xbShow" placeholder="请选择协办单位" @click="xbShow = true" />
								<select-tree ref="xbTree" :show="xbShow" :range="xbList" :selected="xbStr" rangeKey="deptName" :selectParent="false" @confirm="treeConfirm($event, 'xb')" @cancel="treeCancel($event, 'xb')"></select-tree>
							</u-form-item>
							<u-form-item class="form-item" label="分办单位" v-if="handleType == 2">
								<u-input v-model="fbName" type="select" :select-open="fbShow" placeholder="请选择分办单位" @click="fbShow = true" />
								<select-tree ref="fbTree" :show="fbShow" :range="fbList" :selected="fbStr" rangeKey="deptName" :selectParent="false" @confirm="treeConfirm($event, 'fb')" @cancel="treeCancel($event, 'fb')"></select-tree>
							</u-form-item>
						</u-form>
					</view>
					<view class="fiexd-btm">
						<view class="flex-box">
							<u-button class="form-btn" type="error" @click="confirm4">提交</u-button>
							<u-button class="form-btn" type="success" @click="back4">退回</u-button>
						</view>
					</view>
				</block>
				<view class="com-h3" v-else>交办中</view>
			</block>
			<block v-if="['5', '8'].indexOf(motionInfo.nodeStatus) > -1">
				<view class="unit-list" v-if="handlerList.length > 0">
					<view class="unit-item" v-for="(item, index) in handlerList" :key="item.deptId">
						<view class="unit-top">
							<view class="unit-name clamp" @click="$showLine(item)">
								{{ item.deptName }}
								<text class="unit-time">提交时间：{{ item.createTime }}</text>
							</view>
							<view class="right-type" :style="'color: ' + colorMap[item.nodeStatus]">{{ item.nodeStatusName }}</view>
						</view>

						<view class="unit-btm" v-if="item.nodeStatus == '0' && item.deptId == deptId">
							<view class="text" @click="replyTo(item)" v-if="$sysBtns('shh_dafu')">
								填写答复
								<u-icon name="arrow-right" color="#D0021B" size="18"></u-icon>
							</view>
							<view class="text" @click="backTo(item)" v-if="$sysBtns('shh_tiaozheng')">
								申请调整
								<u-icon name="arrow-right" color="#D0021B" size="18"></u-icon>
							</view>
							<view class="text" @click="deferTo(item)" v-if="$sysBtns('shh_yanqi')">
								申请延期
								<u-icon name="arrow-right" color="#D0021B" size="18"></u-icon>
							</view>
						</view>

						<view class="unit-btm" v-if="item.nodeStatus == '1'">
							<view class="text" @click="replyToDetail(item)">
								查看答复件
								<u-icon name="arrow-right" color="#D0021B" size="18"></u-icon>
							</view>
						</view>
					</view>
				</view>

				<view class="fiexd-btm" v-if="motionInfo.handlerRemark1 == '0' && $sysBtns('shh_tuihui')"><u-button class="form-btn" type="error" @click="back4">退回</u-button></view>
			</block>
		</view>
	</view>
</template>

<script>
import dateTimePicker from '@/components/uni-datetime-picker';
import selectTree from '@/components/uni-select-tree.vue';
import uniParse from '@/components/uni-parse/parse.vue';
import { mapState } from 'vuex';
export default {
	components: {
		dateTimePicker,
		selectTree,
		uniParse
	},
	data() {
		return {
			tabsCurrent: 0,
			tabsList: [
				{
					name: '基本信息',
					value: 0
				},
				{
					name: '建议内容',
					value: 1
				},
				{
					name: '建议流程',
					value: 2
				},
				{
					name: '处理建议',
					value: 3
				}
			],
			colorMap: {
				0: '#303133',
				1: '#f29100',
				2: '#18b566',
				3: '#dd6161',
				4: '#0099ff',
				5: '#ff9900',
				6: '#19be6b',
				7: '#ff3333',
				8: '#909399',
				101: '#71d5a1'
			},

			type: '',
			typeShow: false,
			typeList: [],

			checkIdea: '',
			checkIdeaList: [],

			checkIdeaBjs: '',
			checkIdeaBjsList: [],

			form1: {
				type: '',
				checkIdeaBjs: ''
			},

			assignWay: '2',
			assignWayShow: false,
			assignWayList: [
				{
					value: '2',
					label: '政府'
				},
				{
					value: '3',
					label: '交办'
				}
			],

			applyReturnDays: '15天以内',
			applyReturnDaysShow: false,
			applyReturnDaysList: [
				{
					value: '15',
					label: '15天以内'
				},
				{
					value: '30',
					label: '30天以内'
				},
				{
					value: '45',
					label: '45天以内'
				},
				{
					value: '60',
					label: '60天以内'
				}
			],

			form2: {
				assignRemark: '',
				applyReturnDays: '15',
				latestReplyTime: ''
			},

			handleType: '1',
			handleTypeShow: false,
			handleTypeList: [
				{
					value: '1',
					label: '主/协办'
				}
				// {
				// 	value: '2',
				// 	label: '分办'
				// }
			],

			zbIds: [],
			zbName: '',
			zbShow: false,
			zbList: [],
			zbStr: '',

			xbIds: [],
			xbName: '',
			xbShow: false,
			xbList: [],
			xbStr: '',

			fbIds: [],
			fbName: '',
			fbShow: false,
			fbList: [],
			fbStr: '',

			form3: {},

			processList: [],
			handlerList: [],
			id: '',
			deptId: '',
			detailInfo: {},
			motionInfo: {
				id: '',
				title: '',
				userName: '',
				typeName: '',
				createTime: '',
				cause: '',
				suggestion: '',
				background: '',
				content: '',
				jieName: '',
				ciName: '',
				no: '',
				kind: '',
				handlerRemark1: '',
				leaderName: '',
				leaderPhone: '',
				nodeStatus: '',
				hopeBldw: '',
				hopeBldwXb: ''
			},
			jointlerList: [],
			jointlerListName: '',
			leaderInfo: {
				id: '',
				userName: '',
				remark13: ''
			},
			play: false
		};
	},
	onLoad(option) {
		this.loadLogin();
		this.id = option.id;
		this.loadData();

		this.loadDict('motion_type', 'typeList');
		this.loadDict('review_comment', 'checkIdeaList');
		this.loadDict('check_idea_bjs', 'checkIdeaBjsList');
		this.loadHandler();
	},
	onHide() {
		this.$ttsOff();
	},
	onUnload() {
		this.$ttsOff();
	},
	computed: {
		checkIdeaName() {
			return this.valueShow(this.checkIdeaList, this.motionInfo.checkIdea);
		},
		...mapState(['userInfo', 'fileList'])
	},
	methods: {
		loadLogin() {
			if (this.userInfo.Authorization) {
				this.clientCode = this.userInfo.sysUser.clientCode;
				this.userId = this.userInfo.sysUser.id;
				this.deptId = this.userInfo.sysUser.deptId;
				this.wyhdzName = this.userInfo.userInfo.wyhdzName;

				let time = this.$writeCurrentDate();
				this.form2.latestReplyTime = time.year + '-' + time.month + '-' + time.date;
			} else {
				this.$logout();
			}
		},
		loadData() {
			let data = {
				id: this.id,
				currentUserId: this.userId
			};
			this.$request('/motion/query', data, {
				load: true
			}).then((res) => {
				this.$store.commit('filePush', res.data.fileList);
				this.handlerList = res.data.handlerList || [];
				Object.keys(this.motionInfo).forEach((key) => (this.motionInfo[key] = res.data.motion[key]));
				Object.keys(this.leaderInfo).forEach((key) => (this.leaderInfo[key] = res.data.leaderInfo[key]));
				this.jointlerList = res.data.jointlerList;
				if (this.jointlerList && this.jointlerList.length > 0) {
					this.jointlerList.forEach((item, index) => {
						this.jointlerListName += item.userName + (index == this.jointlerList.length - 1 ? '' : ', ');
					});
				}

				let hopeBldwXbList = [];
				this.handlerList.forEach((item) => {
					if (item.type == '1') {
						this.zbStr = item.deptId;
						this.zbIds = [item.deptId];
						this.zbName = item.deptName ? item.deptName : '';
					}
					if (item.type == '2') {
						this.xbIds.push(item.deptId);
						hopeBldwXbList.push({
							id: item.deptId,
							deptName: item.deptName
						});
					}
				});
				if (hopeBldwXbList.length > 0) {
					this.xbStr = this.xbIds.join(',');
					this.treeConfirm(hopeBldwXbList, 'xb');
				}
			});
			this.$request('/motion/processRecord', {
				clientCode: this.clientCode,
				motionId: this.id
			}).then((res) => {
				if (!res.data) {
					return false;
				}
				this.processList = res.data.records || [];
			});
		},
		confirm1() {
			this.$request('/motion/tzCheck', {
				clientCode: this.clientCode,
				currentUserId: this.userId,
				motion: {
					id: this.id,
					checkIdea: '0'
				}
			}).then((res) => {
				this.$msg(res.msg);
				setTimeout(() => {
					this.loadData('refresh');
				}, 500);
			});
		},
		confirm2() {
			this.$request('/motion/check', {
				clientCode: this.clientCode,
				currentUserId: this.userId,
				motion: {
					id: this.id,
					checkIdea: '0'
				}
			}).then((res) => {
				this.$msg(res.msg);
				setTimeout(() => {
					this.loadData('refresh');
				}, 500);
			});
		},
		confirm3() {
			if (this.assignWay == '2') {
				this.$request('/motion/waitAssign', {
					clientCode: this.clientCode,
					currentUserId: this.userId,
					ids: [this.id],
					motion: {
						assignWay: this.assignWay
					}
				}).then((res) => {
					this.$msg(res.msg);

					console.log(this.handleType);
					setTimeout(() => {
						this.loadData('refresh');
					}, 500);
				});
			} else {
				if (this.zbIds.length == 0) {
					this.$msg('主办单位不能为空');
					return false;
				}
				this.$request('/motion/waitAssign', {
					clientCode: this.clientCode,
					currentUserId: this.userId,
					ids: [this.id],
					motion: {
						adviseZb: this.zbIds.join(','),
						adviseXb: this.xbIds.join(','),
						advisefb: this.fbIds.join(','),
						handleType: this.handleType,
						assignWay: this.assignWay
					}
				}).then((res) => {
					this.$msg(res.msg);
					setTimeout(() => {
						this.loadData('refresh');
					}, 500);
				});
			}
		},
		confirm4() {
			if (this.handleType == 1 && this.zbIds.length == 0) {
				this.$msg('主办单位不能为空');
				return false;
			}
			if (this.handleType == 2 && this.fbIds.length == 0) {
				this.$msg('分办单位不能为空');
				return false;
			}
			if (this.handleType == 2 && this.fbIds.length < 2) {
				this.$msg('分办需选择两个或两个以上办理单位');
				return false;
			}
			this.$request('/motion/assign', {
				clientCode: this.clientCode,
				currentUserId: this.currentUserId,
				commitFlag: true,
				motion: {
					adviseZb: this.zbIds.join(','),
					adviseXb: this.xbIds.join(','),
					advisefb: this.fbIds.join(','),
					handleType: this.handleType,
					id: this.id
				}
			}).then((res) => {
				this.$msg(res.msg);
				setTimeout(() => {
					this.loadData('refresh');
				}, 500);
			});
		},
		back1() {
			uni.showModal({
				title: '提示',
				content: '确定退回？',
				success: (res) => {
					if (res.confirm) {
						this.$request('/motion/tzCheck', {
							clientCode: this.clientCode,
							currentUserId: this.userId,
							motion: {
								id: this.id,
								checkIdea: 'th'
							}
						}).then((res) => {
							this.$msg(res.msg);
							setTimeout(() => {
								this.loadData('refresh');
							}, 500);
						});
					} else if (res.cancel) {
						console.log('用户点击取消');
					}
				},
				complete: (res) => {}
			});
		},
		back2() {
			uni.showModal({
				title: '提示',
				content: '确定退回？',
				success: (res) => {
					if (res.confirm) {
						this.$request('/motion/check', {
							clientCode: this.clientCode,
							currentUserId: this.userId,
							motion: {
								id: this.id,
								checkIdea: 'th'
							}
						}).then((res) => {
							this.$msg(res.msg);
							setTimeout(() => {
								this.loadData('refresh');
							}, 500);
						});
					} else if (res.cancel) {
						console.log('用户点击取消');
					}
				},
				complete: (res) => {}
			});
		},
		back3() {
			uni.showModal({
				title: '退回',
				// content: '确定退回？',
				editable: true,
				placeholderText: '请输入退回理由',
				success: (res) => {
					if (res.confirm) {
						if (!res.content) {
							this.$msg('请输入退回理由');
							return false;
						}
						this.$request('/motion/return2check', {
							clientCode: this.clientCode,
							currentUserId: this.userId,
							approveIdea: res.content,
							motion: {
								id: this.id
							}
						}).then((res) => {
							this.$msg(res.msg);
							setTimeout(() => {
								this.loadData('refresh');
							}, 500);
						});
					} else if (res.cancel) {
						console.log('用户点击取消');
					}
				},
				complete: (res) => {}
			});
		},
		back4() {
			uni.showModal({
				title: '退回',
				// content: '确定退回？',
				editable: true,
				placeholderText: '请输入退回理由',
				success: (res) => {
					if (res.confirm) {
						if (!res.content) {
							this.$msg('请输入退回理由');
							return false;
						}
						this.$request('/motion/return2prev', {
							clientCode: this.clientCode,
							currentUserId: this.userId,
							approveIdea: res.content,
							motion: {
								id: this.id
							}
						}).then((res) => {
							this.$msg(res.msg);
							setTimeout(() => {
								this.loadData('refresh');
							}, 500);
						});
					} else if (res.cancel) {
						console.log('用户点击取消');
					}
				},
				complete: (res) => {}
			});
		},
		treeConfirm(e, type) {
			console.log(e);
			if (!e || e.length == 0) {
				this[type + 'Show'] = false;
				this[type + 'Name'] = '';
				this[type + 'Ids'] = [];
				return false;
			}
			if (type == 'zb') {
				this[type + 'Ids'] = [e[0].id];
				this[type + 'Name'] = e[0].deptName;
			} else {
				this[type + 'Ids'] = [];
				let names = [];
				let i = 0;
				e.forEach((item) => {
					this[type + 'Ids'].push(item.id);
					if (i < 2) {
						names.push(item.deptName);
						i++;
					}
				});
				this[type + 'Name'] = names.join(',') + '等' + e.length + '个';
			}
			this[type + 'Show'] = false;
		},
		treeCancel(e, type) {
			this[type + 'Show'] = false;
		},
		tabsChange(index) {
			this.tabsCurrent = index;
		},
		timeChange({ date, dt }, idx) {
			this.form2[idx] = date.year + '-' + date.month2 + '-' + date.day2;
		},
		typeConfirm(e) {
			this.type = e[0].label;
			this.form1.type = e[0].value;
		},
		assignWayConfirm(e) {
			this.assignWay = e[0].label;
			this.form2.assignWay = e[0].value;
		},
		applyReturnDaysConfirm(e) {
			this.applyReturnDays = e[0].label;
			this.form2.applyReturnDays = e[0].value;
		},
		imgpath(path) {
			let typeA = path.split('.');
			let type = (typeA[typeA.length - 1] || 'png').toLowerCase();
			return `/static/img/icon_${type}.png`;
		},
		loadDict(type, list) {
			this.$request('/system/sys-dict/dictList', {
				clientCode: this.clientCode,
				sysDict: {
					dictType: type
				}
			}).then((res) => {
				if (!res.data) {
					return false;
				}
				this[list] = [];
				res.data.forEach((item) => {
					this[list].push({
						value: item.dictValue,
						label: item.dictName
					});
				});
			});
		},
		loadHandler() {
			this.$request('/system/sys-dept/allHandler2', {
				clientCode: this.clientCode,
				currentUserId: this.userId,
				sanshenFlag: '1'
			}).then((res) => {
				this.zbList = res.data;
				this.xbList = res.data;
				this.fbList = res.data;
			});
		},
		navTo(url) {
			uni.navigateTo({
				url: url
			});
		},
		deferTo(item) {
			uni.navigateTo({
				url: '/pagesB/proposal/defer?motionId=' + this.id + '&deptId=' + item.deptId + '&title=' + `${this.motionInfo.title}`
			});
		},
		backTo(item) {
			uni.navigateTo({
				url: '/pagesB/proposal/back?motionId=' + this.id + '&deptId=' + item.deptId + '&title=' + `${this.motionInfo.title}`
			});
		},
		replyTo(item) {
			uni.navigateTo({
				url: '/pagesB/proposal/reply?motionId=' + this.id + '&deptId=' + item.deptId + '&title=' + `对第${this.motionInfo.jieName}${this.motionInfo.ciName}会议第${this.motionInfo.no}号建议的答复`
			});
		},
		replyToDetail(item) {
			uni.navigateTo({
				url: '/pagesB/proposal/detail_reply?motionId=' + this.id + '&deptId=' + item.deptId + '&title=' + `对第${this.motionInfo.jieName}${this.motionInfo.ciName}会议第${this.motionInfo.no}号建议的答复`
			});
		},
		relayToList(item) {
			uni.navigateTo({
				url: '/pagesB/proposal/list_relay?motionId=' + this.id + '&deptId=' + item.deptId
			});
		},
		onTts() {
			let text = this.motionInfo.title;
			text += ',' + this.motionInfo.leaderName;
			text += ',' + this.motionInfo.typeName;
			text += ',' + this.$parseTime(this.motionInfo.createTime, '{y}-{m}-{d}');
			text += '建议内容,' + this.$htmlRegx(this.motionInfo.background);
			this.$tts(text, this, 500);
		},
		valueShow(arr, value) {
			let temp = {};
			if (!!arr) {
				temp = arr.find((item) => {
					return item.value == value;
				});
			}
			if (!!temp) {
				return temp.label;
			}
		},
		previewImage(idx, images) {
			uni.previewImage({
				current: idx,
				urls: images
			});
		}
	}
};
</script>

<style lang="scss">
.detail-view {
	background-color: #fff;
}

.detail-info {
	padding-bottom: 0;
	overflow: hidden;

	.info-title {
		margin-bottom: 0;
	}

	.h2 {
		margin-bottom: 20rpx;
		font-size: 17px;
		font-weight: bold;
		color: #e5231a;
		line-height: 40rpx;
	}
}

// .type-tabs {
// 	margin-top: -40rpx;
// }

.type-boxs {
	.container {
		padding: 20rpx 30rpx;
	}
}

.sched-box {
	padding: 30rpx 30rpx 30rpx 40rpx;
	border-bottom: 20rpx solid $u-border-color;

	.sched-content {
		font-size: 12px;
		color: #666;
		line-height: 44rpx;
		min-height: 44rpx;
	}

	.sched-title {
		margin-bottom: 20rpx;
		font-size: 17px;
		font-weight: bold;
		color: #333;
		line-height: 1;
	}

	.sched-desc {
		font-size: 14px;
		color: #333;
		line-height: 48rpx;
	}
}

.unit-list {
	padding: 30rpx;
	font-size: 17px;
	color: #333;
	line-height: 48rpx;

	.unit-item {
		margin-top: 20rpx;
		padding: 20rpx 30rpx;
		box-shadow: 0px 1rpx 14rpx 0px rgba(201, 201, 201, 0.5);
		border-radius: 12rpx;
		background: #fff;

		&:first-child {
			margin-top: 0;
		}
	}

	.unit-top {
		display: flex;
		align-items: center;
		justify-content: space-between;
	}

	.unit-name {
		width: 85%;
		color: #333;
		// text-decoration: underline;
	}

	.unit-time {
		margin-top: 4rpx;
		display: block;
		font-size: 14px;
		color: #666;
		line-height: 40rpx;
	}

	.unit-btm {
		display: flex;
		justify-content: flex-end;
		margin-top: 12rpx;
		padding-top: 20rpx;
		font-size: 14px;
		color: #e5231a;
		line-height: 40rpx;
		border-top: 2rpx solid #f6f7fb;

		.text {
			margin-left: 36rpx;
		}
	}

	.right-type {
		padding: 15rpx 20rpx;
		border: 0;
		font-size: 15px;
		color: #e5231a;
		word-break: keep-all;
		text-decoration: none;
	}
}

.form-box {
	.form-item {
		@include mp-flex;
	}
}

.fiexd-btm {
	position: static;
	border-top: 10rpx solid $u-border-color;
	padding: 30rpx;
}
</style>
